package com.yida.gwj.expend.outside.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.yida.common.datasource.annotation.Slave;
import com.yida.gwj.common.domain.GwjBaseBuild;
import com.yida.gwj.common.domain.GwjBaseCommunity;
import com.yida.gwj.common.domain.GwjBaseHouse;
import com.yida.gwj.common.domain.GwjBaseOwner;
import com.yida.gwj.common.domain.request.GwjBaseBuildRequest;
import com.yida.gwj.common.service.IGwjBaseBuildService;
import com.yida.gwj.common.service.IGwjBaseCommunityService;
import com.yida.gwj.common.service.IGwjBaseHouseService;
import com.yida.gwj.common.service.IGwjBaseOwnerService;
import com.yida.gwj.expend.outside.domain.dto.GwjHouseOwnerListDTO;
import com.yida.gwj.expend.outside.domain.request.GwjHouseOwnerListRequest;
import com.yida.gwj.expend.outside.mapper.GwjMaintenanceFundsBusinessInnerMapper;
import com.yida.gwj.expend.outside.service.IGwjMaintenanceFundsBusinessInnerService;

/**
 * 内网业务实现
 *
 * @author liangp
 * @date 2023/04/20
 */
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
@Slave
@Service
public class GwjMaintenanceFundsBusinessInnerServiceImpl implements IGwjMaintenanceFundsBusinessInnerService {

    @Autowired
    private IGwjBaseOwnerService baseOwnerService;
    @Autowired
    private IGwjBaseBuildService gwjBaseBuildService;
    @Autowired
    private IGwjBaseHouseService gwjBaseHouseService;
    @Autowired
    private IGwjBaseCommunityService gwjBaseCommunityService;
    @Autowired
    private GwjMaintenanceFundsBusinessInnerMapper innerMapper;

    @Override
    public List<GwjBaseOwner> selectGwjBaseListByGwjBaseHouseCodes(String[] houseCodes, Long areaId) {
        return baseOwnerService.selectGwjBaseListByGwjBaseHouseCodes(houseCodes, areaId);
    }

    @Override
    public List<GwjBaseHouse> selectGwjBaseHouseList(GwjBaseHouse house) {
        return gwjBaseHouseService.selectGwjBaseHouseList(house);
    }

    @Override
    public List<GwjBaseBuild> selectGwjBaseBuildListByCommunityId(Long communityId) {
        return gwjBaseBuildService.selectGwjBaseBuildListByCommunityId(communityId);
    }

    @Override
    public GwjBaseBuild selectGwjBaseBuildByBuildId(Long buildId) {
        return gwjBaseBuildService.selectGwjBaseBuildByBuildId(buildId);
    }

    @Override
    public GwjBaseCommunity selectGwjBaseCommunityByGwjBaseCommunityId(Long id) {
        return gwjBaseCommunityService.selectGwjBaseCommunityByGwjBaseCommunityId(id);
    }

    @Override
    public List<GwjBaseCommunity> selectCommunityList(GwjBaseCommunity community) {
        return gwjBaseCommunityService.selectCommunityList(community);
    }

    @Override
    public List<GwjBaseCommunity> selectGwjBaseCommunityList(GwjBaseCommunity community) {
        return gwjBaseCommunityService.selectGwjBaseCommunityList(community);
    }

    @Override
    public List<GwjBaseBuild> selectGwjBaseBuildListByCommunityIdBuildName(GwjBaseBuild gwjBaseBuild) {
        return innerMapper.selectGwjBaseBuildListByCommunityIdBuildName(gwjBaseBuild);
    }

    @Override
    public List<GwjHouseOwnerListDTO> selectHouseAndOwnerList(GwjHouseOwnerListRequest houseAndOwnerListRequest) {
        return innerMapper.selectHouseAndOwnerList(houseAndOwnerListRequest);
    }

    /* 
     * 获取过滤楼栋信息
     */
    @Override
    public List<GwjBaseBuild> getBuildsFilte(GwjBaseBuildRequest buildRequest) {
        return gwjBaseBuildService.selectGwjBaseBuildDetailList(buildRequest);
    }

}
